/*
 * Copyright (c) 2018-2999 深圳市阿毛科技有限公司 All rights reserved.
 *
 * https://www.lamyz.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.lam.mall.api.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.lam.common.base.domain.Result;
import com.lam.framework.operLog.annotation.Log;
import com.lam.mall.app.vo.AreaVo;
import com.lam.mall.entity.Area;
import com.lam.mall.service.AreaService;

import cn.hutool.core.bean.BeanUtil;

/**
 *
 * @author lgh on 2018/10/26.
 */
@RestController
@RequestMapping("/${frontPath}/area")
@Log(title = "省市区接口")
public class AreaApiController {

    @Autowired
    private AreaService areaService;
    
    /**
	 * 分页获取
	 */
    @GetMapping("/listByPid")
    @Log(oper = "获取省市区信息")
	public Result listByPid(String pid){
		List<Area> list = areaService.listByPid(pid);
		return Result.ok(BeanUtil.copyToList(list, AreaVo.class));
	}
    
}
